hysop.operator.base.transpose_operator module

class hysop.operator.base.transpose_operator.TransposeOperatorBase(input_field, output_field, variables, axes, name=None, pretty_name=None, **kwds)[source]

Bases: object

Common implementation interface for transposition operators.

Initialize a transposition operator operating on CartesianTopologyDescriptors.

input_field: ScalarField

Input continuous scalar field to be transposed, at least 2D.

output_field: ScalarField

Output continuous scalar field where the result is stored Transposed shape should match the input. output_field can be the same as input_field resulting in an inplace transposition.

variables: dict

Dictionary of fields as keys and CartesianTopologyDescriptors as values. Should contain input and output field.

axes: tuple or list of ints

Permutation of axes in numpy notations Axe dim-1 is the contiguous axe, axe 0 has the greatest stride in memory.

kwds: dict

Base class keyword arguments.

discretize()[source]
get_node_requirements()[source]
static get_preferred_axes(src_topo, dst_topo, candidate_axes)[source]

Return preferred transposition scheme (performance-wise) given source and destination topology and possible candidate transposition schemes.

Candidate_axes is a dictionnary containing permutation as keys (tuple of ints), and target transposition state (hysop.constants.TranspositionState) as values.

Target transposition states may be None when not provided by user.

By default, return first axes candidate. If some permutation can reset the field to its default transposition state it is returned instead.

get_work_properties()[source]
output_topology_state(output_field, input_topology_states)[source]
setup(work)[source]